<?php
/*********************************************************************\
* This File is a part of BH-PANEL (Breizh-Heberg Panel v2.1)
* Copyright (C) 2008-2009 the BH Developpers : Vincent Giersch <mail@vincordi.fr>, Cyprien Laleau <fanning.fr@gmail.com> and Edwin Cabiten <marmottes44@hotmail.fr>
* See file AUTHORS to get more informations

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
/*********************************************************************/

if(isset($_SESSION['u_nic'])) {
	include('php/lib/panel_inc.php');
	$title = "Liste des produits";
	$tplinc = "panel-general-produits";
	$parse = 1;
	$tpl->assign(array(
			'iconesleft' => 1
		));
	
	// Porduits Hébergement
	$prod_heberg_ = query("SELECT 
								comptes_heberg.id, 
								comptes_heberg.user_linux,
								UNIX_TIMESTAMP(comptes_heberg.create), 
								UNIX_TIMESTAMP(comptes_heberg.expire)
								FROM comptes_heberg
								WHERE u_nic = '".$_SESSION['u_nic']."'");
									
	While($prod_heberg = mysql_fetch_array($prod_heberg_)) {
		$tpl->assign_array('produits_heb', array(
			'id' => $prod_heberg['id'],
			'user_linux' => $prod_heberg['user_linux'],
			'create' => date('d/m/y H:i',$prod_heberg['UNIX_TIMESTAMP(comptes_heberg.create)']),
			'expire' =>date('d/m/y H:i', $prod_heberg['UNIX_TIMESTAMP(comptes_heberg.create)']),
		));
	}
	
	// Porduits Dom
	$prod_dom_ = query("SELECT 
								comptes_domain.id, 
								comptes_domain.domaine,
								UNIX_TIMESTAMP(comptes_domain.create), 
								UNIX_TIMESTAMP(comptes_domain.expire)
								FROM comptes_domain
								WHERE u_nic = '".$_SESSION['u_nic']."'");
									
	While($prod_dom = mysql_fetch_array($prod_dom_)) {
		$tpl->assign_array('produits_dom', array(
			'id' => $prod_dom['id'],
			'domaine' => $prod_dom['domaine'],
			'create' => date('d/m/y H:i',$prod_heberg['UNIX_TIMESTAMP(comptes_domain.create)']),
			'expire' =>date('d/m/y H:i', $prod_heberg['UNIX_TIMESTAMP(comptes_domain.create)']),
		));
	}
}
else { header("Location:/site/connexion.html"); }
?>